#include "lib.h"
#include "limits.h"

int max(const int x, const int y){
	if (x > y ) return x;
	return y;
}

bool max(int *array, size_t len, int * result){
	if(array == nullptr || len == 0 || result == nullptr)  return false; // error 

	*result = INT_MIN;
	for(size_t i = 0; i < len; ++i){
		if(*result < array[i]){
			*result = array[i];
		}
	}
	return true;
}
